<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>UCenter Administrator's Control Panel</title>
<link rel="stylesheet" href="/public/images/admincp.css" type="text/css" media="all" />
<link rel="stylesheet" href="/public/images/admin.css" type="text/css" media="all" />
<script src="/public/include/js/jquery-1.4.2.min.js" type="text/javascript"></script> 
<script src="/public/include/js/dump.js" type="text/javascript"></script> 
<meta content="Comsenz Inc." name="Copyright" />
<style>
.fixwidth td{padding-left:4px;height:20px;}	
.fixwidth th{padding-left:4px;}	
</style>
</head>
<body>
<div id="append"></div>

<!-- 查询 -->
<form action="/admin/tips">
<table style="height:30px;" width="100%">
	<tr>
		<td width="800"  align="left" style="padding-left:20px;">
			<table id="filter_query">
				<tr>
					<td><b><a href="/target_field=adver_name[]">广告素材:</a></b>
						<span>任意</span>
					</td>
					<td><b><a href="/target_field=sales[]">sales:</a></b>
						<span>任意</span>
					</td>
				</tr>
			</table>
		</td>
		<td>
			<input type="submit" value="筛  选" class="btn" />
		</td>
		<td>
			<a class="othersoff" style="float:right;text-align:center" id="header_menu" onclick="headermenu(this)">菜单</a>
				<ul id="header_menu_menu" style="display: none">
				  <li><a href="#" target="main" class="tabon">图表查询</a></li>
				  <li><a href="#" target="main" class="tabon">数据列表查询</a></li>
				</ul>
		</td>
		
	</tr>
</table>
</form>

<div class="container">
  <h3>数据列表</h3>
  <div class="mainbox">
      <table class="datalist fixwidth"  >
        <tr  class="alt">
        	<th>日期</th>
			<th>序号</th>
			<th>广 告 素 材</th>
			<th>类型</th>
			<th>浏览量</th>
			<th>点击量</th>
			<th>唯一点击量</th>	
			<th>唯一点击率</th>
			<th>播放量</th>
			<th>sales</th>
			<th>备注</th>
        </tr>
		<?php
			if($this->tips){
				foreach($this->tips as $key=>$tip){
		?>
		<tr >
			<td><?php echo $tip->stat_date; ?></td>	
			<td><?php echo $tip->id; ?></td>
			<td class="adver_name"><?php echo $tip->adver_name; ?></td>
			<td>即时新闻</td>
			<td><?php echo $tip->pv_count; ?></td>
			<td><?php echo $tip->click_count; ?></td>
			<td><?php echo $tip->click_only_count; ?></td>
			<td>
				<?php
					$tip->click_only_count  = 	intval($tip->click_only_count);
					$tip->click_count  		= 	intval($tip->click_count);
					$rate = isset($tip->click_count) && $tip->click_count!=0  ? round($tip->click_only_count/$tip->click_count,2)*100 : 0; 
			  		echo $rate.'%'; 
				?>
			</td>
			<td><?php echo $tip->play_count; ?></td>
			<td><?php echo $tip->sales_name; ?></td>
			<td><?php echo $tip->sales_type; ?></td>
        </tr>
		<?php 
				}
			} 
		?>
  		  <tr class="nobg">
          	<td class="tdpage" colspan="11"><?php echo $this->page->render();?></td>
        	</tr>
      </table>
  </div>
</div>
</body>
</html>

<script type="text/javascript"> 
$(function(){  
	$('#filter_query a').click(function(e){
		dump(e.target);
		//alert(e.target.href);
		return false;
		
	});
   $('.container tr:even').addClass('alt');
   $('.container tr:not(.nobg)').hover(function(){
   			$(this).toggleClass('over')
   		},function(){
			$(this).toggleClass('over')
		}
   );
   
});
</script>
<script type="text/javascript"> 
	function headermenu(ctrl) {
		ctrl.className = ctrl.className == 'otherson' ? 'othersoff' : 'otherson';
		var menu = document.getElementById('header_menu_body');
		if(!menu) {
			menu = document.createElement('div');
			menu.id = 'header_menu_body';
			menu.innerHTML = '<ul>' + document.getElementById('header_menu_menu').innerHTML + '</ul>';
			var obj = ctrl;
			var x = ctrl.offsetLeft;
			var y = ctrl.offsetTop;
			while((obj = obj.offsetParent) != null) {
				x += obj.offsetLeft;
				y += obj.offsetTop;
			}
			menu.style.left = x + 'px';
			menu.style.top = y + ctrl.offsetHeight + 'px';
			menu.className = 'togglemenu';
			menu.style.display = '';
			document.body.appendChild(menu);
		} else {
			menu.style.display = menu.style.display == 'none' ? '' : 'none';
		}
	}
</script>

